package cn.iocoder.yudao.module.reading.convert.recommendation;

import cn.iocoder.yudao.module.reading.controller.app.recommendation.vo.RecommendationZoneRespVO;
import cn.iocoder.yudao.module.reading.dal.dataobject.recommendation.RecommendationZoneDO;
import cn.iocoder.yudao.module.reading.dal.dataobject.recommendation.RecommendationZoneItemDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 推荐系统 Convert
 *
 * @author 芋道源码
 */
@Mapper
public interface RecommendationConvert {

    RecommendationConvert INSTANCE = Mappers.getMapper(RecommendationConvert.class);

    @Mapping(source = "zoneName", target = "title")
    @Mapping(target = "itemCount", ignore = true)
    @Mapping(target = "items", ignore = true)
    RecommendationZoneRespVO convert(RecommendationZoneDO bean);

    List<RecommendationZoneRespVO> convertList(List<RecommendationZoneDO> list);

    @Mapping(target = "content", ignore = true)
    RecommendationZoneRespVO.RecommendationItemRespVO convertItem(RecommendationZoneItemDO bean);

    List<RecommendationZoneRespVO.RecommendationItemRespVO> convertItemList(List<RecommendationZoneItemDO> list);

}
